package demo;

import com.taobao.api.ApiException;
import com.taobao.api.DefaultTaobaoClient;
import com.taobao.api.TaobaoClient;
import com.taobao.api.request.LogisticsOfflineSendRequest;
import com.taobao.api.response.LogisticsOfflineSendResponse;

public class ItemSend {

	public static void main(String[] args) {
		
		String appkey = "1021820838";
		String secret = "sandbox2a3b4dbc7f7139ac4d7304bdf";
		final String sessionKey = "6100514c989b9e3202e9af1e58de9777de922c64deeceff3638380614";
		String url = "http://gw.api.tbsandbox.com/router/rest";
		
		TaobaoClient client=new DefaultTaobaoClient(url, appkey, secret);
		LogisticsOfflineSendRequest req=new LogisticsOfflineSendRequest();
		long tid = 192390460056705L;
		req.setTid(tid);//192390460016705L
		req.setOutSid("210283341631");
		req.setCompanyCode("HTKY");
		try {
			LogisticsOfflineSendResponse response = client.execute(req , sessionKey);
			System.out.println(response.getBody());
			System.out.println(response.getShipping().getTid());
		} catch (ApiException e) {
			e.printStackTrace();
		}
	}
}
